<template>
    <div class="main">
        <div id="ContentTop">
            <div class="topleft" @click="backClick">个人习题集</div>
            <div class="topright2" @click="photoClick">
                <img src="../../images/paizhao.png">
            </div>
        </div>
        <section>
            <div class="ptitle">
                <!-- <div style=""></div>
                <span>&nbsp;系统错题</span> -->
            </div>
            <div class="pContent">
                <span class="div_img" v-for="item in subjectList" @click="jumpSubject(item.value)">
                    <img :src="item.imgSrc" :alt="item.imgSrc" />
                    <p>{{ item.text }}</p>
                </span>
            </div>
            <div class="pline"></div>
            <div @click="xxctClick" class="showList">
                <img src="../../images/bq.png" width="8">
                <span class="span_gray">线下传题</span>
            </div>
            <div @click="favClick" class="showList">
                <img src="../../images/bq.png" width="8">
                <span class="span_gray">收藏题</span>
            </div>
        </section>

    </div>
</template>

<script>
window.photoStringSubNameStr = function() {
    return localStorage.getItem('ExamType');
}
export default {
    data: function() {
        return {
            subjectList: [{
                    text: '固定练习',
                    value: 'gdlx',
                    imgSrc: require('images/gdlx.png')
                },
                {
                    text: '智能练习',
                    value: 'znlx',
                    imgSrc: require('images/znlx.png')
                },
                {
                    text: '难题挑战',
                    value: 'nttz',
                    imgSrc: require('images/nttz.png')
                }
            ]
        }
    },
    created: function(){
        // window.photoStringSubNameStr = this.photoStringSubName();
    },
    methods: {
        delLocal() {
            localStorage.removeItem('guid');
            window.location.reload();
        },
        jumpSubject(value) {
            if (value == 'znlx') {
                this.$router.replace('/doexam?name=' + value);
                return;
            }
            this.$router.push('/fixedexercise' + '?titlename=' + value);
        },
        photoClick() {
            // 安卓方法
            if (window.android) {
                if (window.android.openPhotoes) {
                    window.android.openPhotoes();
                    return;
                }
                this.$vux.alert.show({ content: '请下载考研app使用线下传题！', title: '温馨提示' });
                return;
            }
            this.$vux.alert.show({ content: '请下载考研app使用线下传题！', title: '温馨提示' });
            return;
        },
        photoStringSubName() {
            // return '安卓方法';
            this.$vux.alert.show({ content: '已经调用方法', title: '温馨提示' });
            return '安卓方法';
        },
        xxctClick() {
            this.$router.push('/fixedexercise?titlename=xxct');
            return;
            if (window.android) {
                if (window.android.getListInfo) {
                    this.$router.push('/fixedexercise?titlename=xxct');
                    return;
                }
                this.$vux.alert.show({ content: '请下载考研app使用线下传题！', title: '温馨提示' });
                return;
            }
            this.$vux.alert.show({ content: '请下载考研app使用线下传题！', title: '温馨提示' });
            return;
        },
        favClick() {
            this.$router.push('/fixedexercise?titlename=sc');
        },
        backClick() {
            this.$router.push('/selectsub');
        }
    }
}

</script>

<style lang="less" scoped>
html, body {
    width: auto;
    height: auto;
}
.div_img {
    width: 100px;
    display: inline-block;
    padding: 5px;
    text-align: center;
    img {
        width: 80px;
    }
    p {
        margin: 0;
        font-size: 1.6rem;
        padding-bottom: 15px;
        color: #000;
        display: inline-block;
    }
}

.span_gray {
    color: #888;
    margin-left: 5px;
    font-size: 1.6rem;
}

#ContentTop {
    position: fixed;
    _position: absolute;
    top: 0;
    /*_top: expression(documentElement.scrollTop);*/
    left: 0px;
    z-index: 1;
    width: 100%;
    height: 50px;
    line-height: 50px;
    background-color: #fff;
    .topleft {
        float: left;
        /*width: 80%;*/
        width: 100%;
        background: url("../../images/qhkm.png") no-repeat 12px;
        background-size: 20px;
        color: #333;
        text-align: center;
        overflow: hidden;
        font-size: 20px;
        /*padding-left: 30px;*/
        cursor: pointer;
    }
    .topright2 {
        width: 8%;
        line-height: 39px;
        padding: 19px 0 0 10px;
        position: absolute;
        right: 0px;
        height: 30px;
        img {
            float: right;
            margin-right: 8px;
            margin-top: -5px;
            width: 23px;
        }
    }
}

section {
    margin-top: 55px;
    .ptitle {
        font-size: 1.6rem;
        padding: 15px;
        div {
            float: left;
            background-color: #ff7600;
            width: 5px;
            height: 20px;
        }
    }
    .pContent {
        text-align: center;
    }
    .pline {
        width: 100%;
        height: 10px;
        background-color: #f3f3f3;
    }
    .showList {
        border-bottom: 1px solid #f3f3f3;
        padding: 15px;
    }
}

.b_rel {
    width: 100%;
    height: 45px;
    font-size: 14px;
    background-color: #4093DA;
    line-height: 45px;
}
.weui-dialog__hd {
    padding: 1.3em 1.6em 1em;
}
.weui-toast__content {
    color: #fff;
}

</style>